@import '../core/theming/palette';
@import '../core/theming/theming';
@import '../core/theming/private';
@import '../core/style/form-common';
@import '../core/typography/typography-utils';


// Theme styles that only apply to the standard appearance of the form-field.

@mixin mat-form-field-standard-color($config-or-theme) {
  $config: mat-get-color-config($config-or-theme);
  $foreground: map-get($config, foreground);
  $is-dark-theme: map-get($config, is-dark);

  $underline-color: mat-color($foreground, divider, if($is-dark-theme, 0.7, 0.42));

  .mat-form-field-appearance-standard {
    .mat-form-field-underline {
      background-color: $underline-color;
    }

    &.mat-form-field-disabled .mat-form-field-underline {
      @include mat-private-control-disabled-underline($underline-color);
    }
  }
}

@mixin mat-form-field-standard-typography($config-or-theme) {}

@mixin _mat-form-field-standard-density($config-or-theme) {}

@mixin mat-form-field-standard-theme($theme-or-color-config) {
  $theme: mat-private-legacy-get-theme($theme-or-color-config);
  @include mat-private-check-duplicate-theme-styles($theme, 'mat-form-field-standard') {
    $color: mat-get-color-config($theme);
    $density: mat-get-density-config($theme);
    $typography: mat-get-typography-config($theme);

    @if $color != null {
      @include mat-form-field-standard-color($color);
    }
    @if $density != null {
      @include _mat-form-field-standard-density($density);
    }
    @if $typography != null {
      @include mat-form-field-standard-typography($typography);
    }
  }
}
